package cn.hznc.domain.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
 * @Author：Administrator
 * @Date：2023/9/19 11:33
 */
@Getter
@Setter
@Table(name = "t_icabinet_record")
@TableName(value = "t_icabinet_record")
public class ICabinetRecordEntity{

    /**
     * 主键
     */
    @Column(name = "id",type = MySqlTypeConstant.INT,length = 11,isKey = true,isAutoIncrement = true)
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 加料取料单类型
     */
    @Column(name = "type",type = MySqlTypeConstant.VARCHAR,length = 50)
    @TableField("type")
    private String type;

    /**
     * 日期
     */
    @Column(name = "time",type = MySqlTypeConstant.DATETIME)
    @TableField("time")
    private Date time;

    /**
     * 操作人员
     */
    @Column(name = "operator",type = MySqlTypeConstant.VARCHAR , length = 50)
    @TableField("operator")
    private String operator;

    /**
     * 分组
     */
    @Column(name = "group_name",type = MySqlTypeConstant.VARCHAR , length = 50)
    @TableField("group_name")
    private String groupName;

    /**
     * 机床
     */
    @Column(name = "machineTool",type = MySqlTypeConstant.VARCHAR , length = 50)
    @TableField("machineTool")
    private String machineTool;

    /**
     * 图纸
     */
    @Column(name = "paper",type = MySqlTypeConstant.VARCHAR , length = 50)
    @TableField("paper")
    private String paper;

    /**
     * 工艺
     */
    @Column(name = "craft",type = MySqlTypeConstant.VARCHAR , length = 50)
    @TableField("craft")
    private String craft;

    /**
     * 料号
     */
    @Column(name = "partno",type = MySqlTypeConstant.VARCHAR , length = 50)
    @TableField("partno")
    private String partno;

    /**
     * 品名
     */
    @Column(name = "typeName",type = MySqlTypeConstant.VARCHAR , length = 50)
    @TableField("typeName")
    private String typeName;

    /**
     * 品牌
     */
    @Column(name = "brand",type = MySqlTypeConstant.VARCHAR , length = 50)
    @TableField("brand")
    private String brand;

    /**
     * 规格型号
     */
    @Column(name = "partType",type = MySqlTypeConstant.VARCHAR , length = 50)
    @TableField("partType")
    private String partType;

    /**
     * 单位
     */
    @Column(name = "unit",type = MySqlTypeConstant.VARCHAR , length = 50)
    @TableField("unit")
    private String unit;

    /**
     * 单位数量
     */
    @Column(name = "unitNumber",type = MySqlTypeConstant.VARCHAR , length = 50)
    @TableField("unitNumber")
    private String unitNumber;

    /**
     * 单价
     */
    @Column(name = "price",type = MySqlTypeConstant.VARCHAR , length = 50)
    @TableField("price")
    private String price;

    /**
     * 通道库存
     */
    @Column(name = "locationNumber",type = MySqlTypeConstant.VARCHAR , length = 50)
    @TableField("locationNumber")
    private String locationNumber;

    /**
     * 件数
     */
    @Column(name = "pcs",type = MySqlTypeConstant.VARCHAR , length = 50)
    @TableField("pcs")
    private String pcs;

    /**
     * 数量
     */
    @Column(name = "number",type = MySqlTypeConstant.VARCHAR , length = 50)
    @TableField("number")
    private String number;

    /**
     * 单价
     */
    @TableField(exist = false)
    private Double sortPrice;


    /**
     * 数量
     */
    @TableField(exist = false)
    private Integer sortNumber;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ICabinetRecordEntity that = (ICabinetRecordEntity) o;

        return time.equals(that.time);
    }

    @Override
    public int hashCode() {
        return time.hashCode();
    }
}
